//package cn.itcast.search.controller;
//
//import cn.itcast.feign.client.UserClient;
//import cn.itcast.hmall.dto.common.ThreadLocalUtil;
//import cn.itcast.hmall.pojo.user.Address;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
//@RestController
//@RequestMapping("/address")
//public class UserController {
//
//    @Autowired
//    private UserClient userClient;
//
//    @RequestMapping("/{uid}")
//    public List<Address> queryAddressList(@PathVariable("uid") String uid){
//        System.out.println("item服务要去远程调用用户服务获取地址列表");
//        Long userId = ThreadLocalUtil.getUserId();
//        System.out.println("拿到ThreadLocal里面的用户ID"+userId);
//        if(userId!=null){
//            List<Address> addressList = userClient.findById(userId);
//            return addressList;
//        }
//        throw new RuntimeException("用户的ID没有获取到");
//
//    }
//
//}
